# coding=utf8
import enum

# mysql 所在服务器地址
MySQLServerIP = "192.168.0.200"
MySQLServerIP_199 = "192.168.0.199"
MySQLServerIP_200 = "192.168.0.150"
MySQLServerIP_Slky_AliYun = "47.113.103.210"

HKIPODB = "hkipo"
HKHOLD = "stockhkhold"
# 各个投行持仓的情况
HKHOLDDetail = "stockhkholddetail"
StockHKHoldDetailTablePrefix = "hk_hold_detail_"

# 个股日线数据db，内部包含质押数据和a股基本数据
StockBasicInfoDB = "stockdailyinfo"
StockBasicInfoTableName = "a_stock_basic_info"
AStockDailyTableName = "stock_daily"
AStockSuspendTableName = "stock_daily_suspend"
AStockNewIPOTableName = "stock_daily_ipo"
AStockFuQuanRatioTableName = "stock_fuquan_ratio"

AStockPledgeDB = "stockpledge"
AStockPledgeTable = "a_stock_pledge"

AStockTagDB = "stocktag"
AStockTagTable = "stocktag"
AStockTagRelationTable = "stocktagrelation"

StockTick2019DB = "stocktick2019"
StockTickTable = "stock_tick_{}_2019"

StockOrder2019DB = "stockorder2019"
StockOrderTable = "order_data_{}_2019"

StockTransaction2019DB = "transaction2019"
StockTransctionTable = "transaction_data_{}_2019"

# 财务报表
FinancialDB = "financialreport"
StockIncomeIndicator = "income"
StockBalancesheetIndicator = "balancesheet"
StockCashflowIndicator = "cashflow"
FinancialDBPath = "ExternalFiles/FinancialReport.db"

# 个股统计数据数据库, 根据个股统计数据
StockDailyStatisticDB = "stockdailystatistic"
AStockStatisticTablePrefix = "a_statistic_info_"
AStockCalculateTablePrefix = "a_calculate_"

# 华泰数据表，
HTStockOneMinDB = "htstockoneminkline"
HTStockBasicTable = "stockbasicinfo_"

# 股票涨停价跌停价格数据，主要是每天计算是否涨跌停的基础数据，新数据从华泰获得，历史数据从tushare获得
StockLimitPriceDB = "stocklimitprice"
StockLimitPriceTable = "stock_limit_price_"

# 论坛帖子数据库表
ForumPostsMysqlDB = "ForumPosts"
ForumPostsDB = "ForumPosts.db"
TaogubaPosts = "taogubaposts"
HuDongYiQuestionTableName = "hudongyiquestion"
ForumPosts_LMysqlDB = 'forumposts'

# 利多利空db
LiduoLikongDB = "stockexinfo"
LiduoLikongTable = "stockannounce"

StockAnnounceDB = "stockannounce"
LiduoLikongForCodeTablePrefix = "announce_"

StockHKHoldDB = "stockhkhold"
StockHKHoldTablePrefix = "hk_hold_"

# 获取利多利空数据的服务器
shenzhendomain = "http://www.szse.cn/disclosure/listed/bulletinDetail/index.html?"
shenzhenreportdomain = "http://reportdocs.static.szse.cn"
shanghaidomain = "http://www.sse.com.cn"
eastmoneysearchformat = "http://so.eastmoney.com/web/s?keyword=%27{}%27&pageindex=1"

# a股股票一分鐘k线数据库
Stock1MinDB = "stockoneminkline"
AStock1MinTableName = "stock_one_min"

# 股票一日k线
StockOneDayKLineDB = 'stockonedaykline'
CodeTagWeightTableName = 'code_tag_weight'
StockBasicTableName = 'stockbasic'
StockTagRenameTableName = 'tag_rename'
CodeTagDateWeightTempTableName = 'code_tag_date_weight_temp'
CodeTagDateTableName = 'code_tag_date'

#
Stock1DayKLineDB = "stock1daykline"

TagStatusTableName = "tag_status"
CodeTagRelationTableName = "code_tag_relation"
# a股股票一分鐘k线数据库
MarketInfoDB = "marketstatistic"
MarketThermometerTableName = "market_thermometer"
MarketThermometerAutoTableName = "market_temperature_auto"
MarketProfitAutoTableName = "market_profit_auto"
MarketProfitAutoTableRecalculateName = "market_profit_auto_recalculate"
MarketFirstLimitProfitName = "market_first_limit_profit_auto"
MarketHighLimitTableName = "market_highlimit"
MarketLowLimitTableName = "market_lowlimit"
MarketReachHighLimitTableName = "market_reach_highlimit"
MarketReachLowLimitTableName = "market_reach_lowlimit"
MarketHighLimitTempTableName = "market_highlimit_temp"
MarketLowLimitTempTableName = "market_lowlimit_temp"
MarketChaoDieTempTableName = "market_chaodie_temp"
MarketHighContinuousTableName = "market_highlimit_continuous"
MarketKaiPanLaTableName = "market_kaipanla"
MarketKaiPanLaTrendTableName = "market_trend_kaipanla"
MarketTemperatureAutoTableName = "market_temperature_auto"
MarketHighlimitAutoTableName = "market_highlimit_auto"
MarketHighLimitAutoTableName = "market_highlimit_auto"

SelectStockToolRootPath = "D:/Tools/SelectStock/"
SelectStockToolPath = "D:/Tools/SelectStock/ExternalFiles/"
SelectStockWebPagePath = "D:/Tools/SelectStock/webpage/"
SelectStockToolDB = "StockIndicator.db"
SelectStockToolAnnounceTablePrefix = "announce_"

SelectStockTagDB = "StockTag.db"
SelectStockToolTagTable = "stocktag"

# 股票日历
StockCalendarDB = "stockcalendar"
TuShareStockBasicTableName = "stockbasic"

# 多种股票信息
StockDdataOverDB = 'stockdataoverview'
SseStockDateOverViewTableName = 'sse_stock_date_overview'
SZSEChuangYeBoardDateOverViewTableName = 'szse_chuang_ye_stock'
SZSEMotherBoardDateOverViewTableName = 'szse_mother_board_stock'
SZSEShengShiExchangeTableName = 'szse_sheng_shi_stock'
EastMoneyGDPTableName = 'eastmoney_gdp'
DataStatsGDPTradeTableName = 'data_stats_gdp_trade'
DataStatsPMITableName = 'data_stats_pmi'
DataStatsCPIAndPPITableName = 'data_stats_cpi_ppi'
MoneySupplyTableName = 'money_supply'
ShiborTableName = 'shibor_tushare'
LiborTableName = 'libor_tushare'
HiborTableName = 'hibor_tushare'
DragonTableName = 'top_list_tushare'
IXICTableName = 'ixic_investing'
SPXInvestingTableName = 'spx_investing'
DJIInvestingTableName = 'dji_investing'
N225InvestingTableName = 'n225_investing'
HSIInvestingTableName = 'hsi_investing'
DXYInvestingTableName = 'dxy_investing'
XauCnyTableName = "xau_cny_investing"
SSECTableName = "ssec_investing"
InnerBankBorrowingChinamoneyTableName = "inner_bank_borrowing_chinamoney"
CollateralisedRepoTableName = "collateralised_repo_chinamoney"

StockTagManagerDB = "stock_tag_manager"
# mysql连接的用户名和密码
MYSQLServerPW_SLKY_ALIYUN = '610c0abed74f4b86'
MYSQLServerPW_H_Local = "h303567469"
LimitType = enum.Enum('LimitType', ('IPO', 'KeChuang', 'FuPai'))

MySQL_OperatePath = "D:/LoadWorkshop/"

FORMAT = lambda x: '%.2f' % x
